//
//  UIResponder+firstResponder.m
//  JuanRoobo
//
//  Created by Zhi Kuiyu on 15/2/28.
//  Copyright (c) 2015年 Zhi Kuiyu. All rights reserved.
//

#import "UIResponder+firstResponder.h"
#import <objc/runtime.h>
#import "UITextField+InputText.h"

@implementation UIResponder (firstResponder)
static __weak id currentFirstResponder;

+(id)currentFirstResponder {
    currentFirstResponder = nil;
    [[UIApplication sharedApplication] sendAction:@selector(findFirstResponder:) to:nil from:nil forEvent:nil];
    return currentFirstResponder;
}


- (void) findFirstResponder:(id) sender {
    if([self isKindOfClass:[UITextField class]] && ((UITextField *)self).enableMoveView){
        currentFirstResponder = self;
    }
}

@end
